<script>
	import {httpUrl, whiteList, LOGIN_PAGE} from './util/config.js'
	import store from './util/store/index.js'
	export default {
		onLaunch: function() {
			// 接口拦截
			uni.addInterceptor('request', {
				invoke(res) {
					let uriArray = res.url.split(httpUrl)
					let token = uni.getStorageInfoSync('token')
					if (!whiteList.includes(uriArray[1]) && !token) {
						uni.reLaunch({
							url: LOGIN_PAGE
						})
					}
				}
			})
		},
		onShow: function() {},
		onHide: function() {}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "uview-ui/index.scss";
</style>
